package com.kylin.core.payment.event.repository;

import com.kylin.dal.entity.marketing.groupon.GrouponAppliedEntry;
import com.kylin.dal.entity.marketing.groupon.GrouponAppliedRepository;
import com.querydsl.jpa.impl.JPAQueryFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.persistence.EntityManager;

/**
 * 支付数据处理类
 * @author Damon S.
 * @version v1.0.1
 * @date 2019年12月04日 20:04
 */
@Slf4j
@Component
public class PaymentDataHandler {

    private final JPAQueryFactory paymentQueryFactory;
    private final GrouponAppliedRepository grouponAppliedRepository;

    public PaymentDataHandler(@Qualifier("kylinArtworkEntityManager")
                                      EntityManager entityManager,
                              GrouponAppliedRepository grouponAppliedRepository) {
       this.paymentQueryFactory = new JPAQueryFactory(entityManager);
       this.grouponAppliedRepository = grouponAppliedRepository;
    }

    public void persistCrashLog() {
        GrouponAppliedEntry entry = GrouponAppliedEntry.builder().build();
//        crashLogRepository.saveAndFlush(entry);
    }
}
